<template>
  <div>
    <el-dialog
      title="取消审核采购订单"
      :visible.sync="visible"
      :modal-append-to-body="false"
      :close-on-press-escape="false"
      :close-on-click-modal="false"
      @close="closeDialog"
      
      width="500px"
    >
      <p>请确认是否取消审核单号: {{form.ref}} 的采购订单?</p>

      <div slot="footer" class="dialog-footer">
        <el-button @click="visible = false">取 消</el-button>
        <el-button type="primary" @click="Submit()">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    form: {
      style: Object
    }
  },
  data() {
    return {
      submit: {},
      visible: true
    };
  },
  methods: {
    Submit() {
      this.form.billstatu = "待审核";
      this.$http.post("/order/updata", this.form).then(response => {
        if (response.data == "success") {
          if (response.data == "success") {
            this.$message({
              message: "审核完成",
              type: "success"
            });
            this.NeedRefresh();
            this.visible = false;
          }
        }
      });
    },
    closeDialog() {
      this.$emit("dialog-close");
    },
    NeedRefresh() {
      this.$emit("refresh");
    }
  }
};
</script>

<style>
</style>